package com.atguigu.lease.app.mapper;

import com.atguigu.lease.model.bean.ApartmentFeeValue;
import com.atguigu.lease.model.vo.apartment.FeeValueVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author YouKinn
* @description 针对表【apartment_fee_value(公寓&杂费关联表)】的数据库操作Mapper
* @createDate 2025-06-20 20:18:16
* @Entity com.atguigu.lease.model.bean.ApartmentFeeValue
*/
public interface ApartmentFeeValueMapper extends BaseMapper<ApartmentFeeValue> {

    @Select("""
        SELECT t2.* , t3.`name` fee_key_name 
        FROM apartment_fee_value t1
        join fee_value t2
        on t2.is_deleted = 0 and t2.id = t1.fee_value_id
        join fee_key t3
        on t3.is_deleted = 0 and t3.id = t2.fee_key_id
        where t1.is_deleted = 0 and t1.apartment_id = #{apartmentId}

""")
    List<FeeValueVo> selectFeeValueVoList(Long apartmentId);
}




